package com.dreamwhale.machinery.pay.weChat.server;

import com.alipay.api.AlipayApiException;
import com.dreamwhale.machinery.config.DataResult;
import com.dreamwhale.machinery.pay.weChat.utils.WxNotifyParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;

public interface WeChatPayServer {


    WxNotifyParam orderPay(String orderId, String body, BigDecimal money, String backJsonInfo, HttpServletRequest request, HttpServletResponse response) throws AlipayApiException;

    /**
     * @param : money 钱
     * @param : userId 用户id
     * @return :
     * @MethodName :  recharge
     * @Description : 充值
     * @Author : Dragon
     * @Data : 18:49 2020/6/23
     */
    DataResult recharge(BigDecimal money, Integer userId, HttpServletRequest request, HttpServletResponse response);

    /**
     * @param : orderId 订单号
     * @param : userId 用户id
     * @return :
     * @MethodName : order
     * @Description : 订单支付
     * @Author : Dragon
     * @Data : 18:49 2020/6/23
     */
    DataResult order(String orderId, Integer userId, HttpServletRequest request, HttpServletResponse response);

    /**
     * @param : request 请求信息
     * @return :
     * @MethodName : notify
     * @Description : 回调
     * @Author : Dragon
     * @Data : 18:50 2020/6/23
     */
    String notify(HttpServletRequest request, HttpServletResponse response);

    /**
     * @param : orderId 订单id
     * @param : reason 原因
     * @return :
     * @MethodName : refund
     * @Description : 退款
     * @Author : Dragon
     * @Data : 18:56 2020/6/23
     */
    DataResult refund(String orderId, String reason);

    /**
     * @param : null
     * @return :
     * @MethodName : orderApply
     * @Description : 报名支付
     * @Author : DragonUncle
     * @Data : 15:49 2020/6/28
     */
    DataResult orderApply(String orderId, Integer userId, Integer pid, HttpServletRequest request, HttpServletResponse response);

    /**
     * @param : orderId 订单id
     * @param : userId  用户id
     * @return :
     * @MethodName : vipRecharge
     * @Description : 会员充值
     * @Author : DragonUncle
     * @Data : 14:05 2020/7/8
     */
    DataResult vipRecharge(String orderId, Integer userId);
}
